# Contributor: Antoni Aloy <aaloytorrens@gmail.com>
# Maintainer: Pedram Pourang <tsujan2000@gmail.com>
pkgname=featherpad
pkgver=1.5.1
pkgrel=0
pkgdesc="Lightweight Qt plain-text editor"
url="https://github.com/tsujan/FeatherPad"
license="GPL-3.0-or-later"
arch="all"
makedepends="
	cmake
	hunspell-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-lang"
options="!check" # no test suite
source="https://github.com/tsujan/FeatherPad/releases/download/V$pkgver/FeatherPad-$pkgver.tar.xz"
builddir="$srcdir/FeatherPad-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

lang() {
	amove usr/share/$pkgname/translations
}

sha512sums="
772b62a23c0631701fb9f676390578c6e05c05e07ff8e24bc5e783355e3f360b88564d98809ef4365fd8f081c41b34c017cf34212e14505fc1bc852a1a415f83  FeatherPad-1.5.1.tar.xz
"
